package com.tian.convert;

import com.tian.dto.StationInfoRespDto;
import com.tian.entity.Station;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年05月12日 11:54
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 */
public class StationConvertUtil {
    public static List<StationInfoRespDto> convert(List<Station> stationList) {
        List<StationInfoRespDto> stationInfoRespDtoList = new ArrayList<>();
        for (Station station : stationList) {
            StationInfoRespDto stationInfoRespDto = new StationInfoRespDto();
            stationInfoRespDto.setLongitude(station.getLongitude());
            stationInfoRespDto.setDimensionality(station.getDimensionality());
            stationInfoRespDto.setStationName(station.getStationName());
            // TODO: 2023/5/11 待转换
            stationInfoRespDtoList.add(stationInfoRespDto);
        }
        return stationInfoRespDtoList;
    }
}
